home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Invisible Universe
/
Invisible Universe (1995)(Voyager)[Mac-PC].iso
/
mac
/
MOVIES
/
MIAWS
/
_NAV.DIR
/
00005_Script_popup stuff
< prev
next >
Wrap
Text File
|
1995-11-13
|
8KB
|
302 lines
on setView theViews, theType
global gNavType,gNavViews,gNavViewSelect
-- theType is Visible,Radio,Microwave,Hydrogen,Infrared
-- otherwise theViews is used to determine theType
-- theViews is a property list where the property is the label name
-- and the value is the full name of the view: GANDV:"Andromeda Galaxy (Visible)"
-- VIEWV,VIEWR,VIEWM,VIEWH,VIEWI,VIEW2,VIEW3,VIEW4,VIEW5,VIEW6,VIEW7
put empty into gNavViews
if voidP(theType) then --multiple views
--put ">>> setView in _Nav (view)" & theViews
put "VIEW"&string(count(theViews)) into gNavType
put theViews into gNavViews
setViewPopUp
else
--put ">>> setView in _Nav (type)" & theType
set gNavType = theType
end if
go frame gNavType
end setView
on setViewPopUp
global gLabels
global gNavViewPop, gNavViews,gNavViewSelect, gCurLabelProp
global gNavViewPopList, gOpenPopMenu
--put ">>>setViewPopUp in _NAV"
put value(string(gNavViews)) into temp
--put ">>>temp in setViewPopUp" && temp
--
--
-- Replace each item with the full value
--
repeat with i = 1 to count(temp)
set full = getAProp(gLabels, getAt(temp, i))
setAt(temp, i, getAt(full, 1))
end repeat
--put ">>> pop up items: " & listToItems(temp)
--put ">>>PopMenu objectP: " & objectP(PopMenu)
if the machineType = 256 then
-- if objectP(gNavViewPop) then
-- gNavViewPop(mDispose)
-- else
-- openPopMenu
-- end if
-- set gNavViewPop = PopMenu(mNew, listToItems(temp), 599)
-- gNavViewPop(mSetItemMark, 18)
set gNavViewPop = listToItems(temp)
else
if voidP(gOpenPopMenu) then
openPopMenu
end if
set gNavViewPopList = listToItems(temp)
end if
put getPos(gNavViews, gCurLabelProp) into gNavViewSelect
end setViewPopUp
on doViewPop
--put ">>> doViewPop"
global gNavViewPop, gNavViewSelect, gNavViews, gNavViewPopList
global gStageLeft, gStageTop, gStageRight, gStageBottom
global gChoice, gNavPalette
-- set hPos = the left of sprite (the clickOn) + gStageLeft + 1
-- set vPos = the top of sprite (the clickOn) + gStageTop
--
set hPos = the left of sprite (the clickOn)
set vPos = the bottom of sprite (the clickOn)
--put ">>>click on, h, v" && the clickOn && hPos && vPos
-- dmd change per paul...
--set hPos = hPos - 50
if the machineType = 256 then
-- set choice = gNavViewPop(mPopNum, hPos, vPos, gNavViewSelect)
set r = the rect of gNavPalette
lCloseNavPalette 1
tell the stage to SetNavShadow(r)
tell the stage to set gChoice = ¼
doDMDPopMenu(gNavViewPop, hPos, vPos, 18, gNavViewSelect)
tell the stage to ClearNavShadow()
lOpenNavPalette
set choice = gChoice
else
set choice = HPopUpMenu(gNavViewPopList, gNavViewSelect, vPos, hPos)
--put "choice = " & quote & choice & quote && stringP(choice) && integerP(choice)
if choice = 0 then exit
set choice = integer(item 3 of choice)
--put "choice = " & quote & choice & quote && stringP(choice) && integerP(choice)
end if
if choice > 0 and choice <> gNavViewSelect then
set gNavViewSelect = choice
--put ">>> doViewPop Choose: " & choice && getaProp(gNavViews, choice)
--lCloseNavPalette
tell the stage to goGo (getaProp(gNavViews, choice))
end if
end DoViewPop
on setPhotosPopUp thePhotos
global gNavPhotoPop, gNavPhotos,gNavPhotoSelect
global gNavPhotoPopList, gOpenPopMenu
--put ">>>setPhotosPopUp _NAV"
set gNavPhotos = thePhotos
if voidP(thePhotos) then
puppetSprite 8,TRUE
set the castNum of sprite 8 = cast "PhotosOff"
updateStage
--put ">>> disabled photos"
exit
end if
--put ">>> enabled photos"
puppetSprite 8, TRUE
set the castNum of sprite 8 = 34
updateStage
puppetSprite 8, FALSE
--beep
put value(string(thePhotos)) into temp
--
--
-- Replace each item with the full value
--
repeat with i = 1 to count(temp)
set full = getAProp(gLabels, getAt(temp, i))
setAt(temp, i, getAt(full, 1))
end repeat
--put ">>>PopMenu objectP: " & objectP(PopMenu)
if the machineType = 256 then
-- if objectP(gNavPhotoPop) then
-- gNavPhotoPop(mDispose)
-- else
-- openPopMenu
-- end if
-- set gNavPhotoPop = PopMenu(mNew,listToItems(temp),999)
-- gNavPhotoPop(mSetItemMark, 0)
set gNavPhotoPop = listToItems(temp)
else
if voidP(gOpenPopMenu) then
openPopMenu
end if
set gNavPhotoPopList = listToItems(temp)
end if
put 0 into gNavPhotoSelect
end setPhotosPopUp
on disableHotSpots
--put ">>> disable hotspots"
puppetSprite 7,TRUE
set the castNum of sprite 7 to cast "HotSpotsOff"
updateStage
end
on EnableHotSpots
puppetSprite 7,FALSE
updateStage
go to the frame
end
on doPhotoPop
global gNavPhotoPop, gNavPhotoSelect
global gStageLeft, gStageTop, gStageRight, gStageBottom
global gSuppPhoto, gNavPhotoPopList
global gChoice, gNavPalette
--
--
-- Note that in a suplemental photo, we disable the
-- nav palette
--
if voidP(gNavPhotos) then exit
-- set hPos = the left of sprite (8) + gStageLeft + 1
-- set vPos = the top of sprite (8) + gStageTop
set hPos = the left of sprite (8)
set vPos = the bottom of sprite (8)
--set hPos = hPos - 50
if the machineType = 256 then
-- set choice = gNavPhotoPop(mPopNum, hPos, vPos, gNavPhotoSelect)
set r = the rect of gNavPalette
lCloseNavPalette 1
tell the stage to SetNavShadow(r)
tell the stage to set gChoice = ¼
doDMDPopMenu(gNavPhotoPop, hPos, vPos, 18, gNavPhotoSelect)
tell the stage to ClearNavShadow(r)
lOpenNavPalette
set choice = gChoice
else
-- set choice = HPopUpMenu(gNavPhotoPopList, gNavPhotoSelect, vPos, hPos)
set choice = HPopUpMenu(gNavPhotoPopList, -1, vPos, hPos)
--put "choice = " & quote & choice & quote && stringP(choice) && integerP(choice)
if choice = 0 then exit
set choice = integer(item 3 of choice)
--put "choice = " & quote & choice & quote && stringP(choice) && integerP(choice)
end if
if choice > 0 then
set gNavPhotoSelect = choice
--put ">>> doPhotoPop Choose: " & choice && getaProp(gNavPhotos, choice)
set gSuppPhoto = 1
--lCloseNavPalette
tell the stage to goGo (getaProp(gNavPhotos, choice))
end if
end DoPopup
on listToItems theList
put empty into it
repeat with i=1 to count(theList)
put getat(theList,i) & RETURN after it
end repeat
put empty into char(length(it)) of it
if length(it) > 256 then put 0 into it
return it
end listToItems
on closeWindow
--undocumented but supported
-- clear out popupXobject
--clearOutPopUp
end closeWindow
on clearOutPopUp
global gNavViewPop, gNavPhotoPop
if objectP(gNavViewPop) then gNavViewPop(mDispose)
if objectP(gNavPhotoPop) then gNavPhotoPop(mDispose)
if the machineType =256 then closeXLib "PopMenu.DLL"
else closeXLib "HierPopUp.XFCN"
end clearOutPopUp
on calculateStageSize
global gStageLeft, gStageTop, gStageRight, gStageBottom
if the machineType <> 256 or the stageLeft = 0 then
--Macintosh is OK, or if the stage is full-screen
set gStageLeft = the stageLeft
set gStageTop = the stageTop
set gStageRight = the stageRight
set gStageBottom = the stageBottom
else
--PC is buggy, must make corrections
set gStageLeft = -the stageLeft -1
set gStageTop = -the stageTop - 1
set gStageRight = the stageRight + the stageLeft - gStageLeft
set gStageBottom = the stageBottom + the stageTop - gStageTop
end if
end calculateStageSize